﻿
using HBase; 
using hCommand;
using hCommand.entity;
using System.Collections.Generic;
namespace api
{
    [RoutePrefix("api/param")]
    public class ParamServe :BaseApiController {
        ISysServer wcsServer = WMSDalFactray.getDal<ISysServer>();
        [HttpGet, Route("updateCraneOverStop/{craneId}/{value}")]
        public bool UpdateCraneOverStop(int craneId ,int value) {
            wcsServer.update("crane" ,craneId ,"overStop" ,value);
 
            return true;
        }
        [HttpGet, Route("GetCraneOverStop/{craneId}")]
        public BaseResult GetCraneOverStop(int craneId) {
            BParam param = wcsServer.getById<BParam>("",craneId);
            return BaseResult.Ok(param.v);
        }
        [HttpGet, Route("updateParam/{driveType}/{driveId}/{key}/{value}")]
        public BaseResult updateParam(string driveType ,int driveId ,string key ,int value) {
            bool res = wcsServer.update(driveType ,driveId ,key ,value);
          
            return BaseResult.Ok(res);
        }
        [HttpGet, Route("getParams")]
        public BaseResult getParams() {
           
            List<BParam> res = wcsServer.getParams(); ;
            return BaseResult.Ok(res);
        }
    }
}
